package com.yikome.promotion.enums;

public enum CouponStatus {

	CREATE(0 , "已创建") , 
	
	ACTIVE(10 , "运行中") , 
	
	INVALID(-10 , "已下线");
	
	
	private int status ; 
	private String statusName ;
	
	private CouponStatus (int status , String statusName) {
		this.status = status; 
		this.statusName = statusName;
	}

	public int getStatus() {
		return status;
	}

	public String getStatusName() {
		return statusName;
	}
	
	public static CouponStatus byStatus(int status) {
		CouponStatus[] everyFullReductionStatues = CouponStatus.values();
		for (CouponStatus tmp : everyFullReductionStatues) {
			if(tmp.getStatus() == status) {
				return tmp;
			}
		}
		return null;
	}
}
